package com.black.cat.core;

import com.black.cat.lang.Nullable;

import java.io.Serializable;
import java.lang.reflect.Type;

public class ResolvableType implements Serializable {


    @Nullable
    private Class<?> resolved;

    private final Type type;

    private ResolvableType(@Nullable Class<?> clazz) {
        this.resolved = (clazz != null ? clazz : Object.class);
        this.type = this.resolved;
//        this.typeProvider = null;
//        this.variableResolver = null;
//        this.componentType = null;
//        this.hash = null;
    }

    @Nullable
    public Class<?> resolve() {
        return this.resolved;
    }

    public static ResolvableType forClass(@Nullable Class<?> clazz) {
        return new ResolvableType(clazz);
    }
}
